<?php
namespace app\common\enum;

/**
 * 任务相关 枚举类型
 * Class OrderEnum
 * @Author FZR
 * @package app\common\enum
 */
class CrontabEnum
{

    const Status_RUNING = 1;//运行
    const Status_STOP = 2;//停止
    const Status_ERR = 3;//错误



    /**
     * @Notes: 订单状态
     * @Author: Toren
     * @param bool $type
     * @return array|mixed|string
     */
    public static function getStatus($type=true)
    {
        $desc = [
            self::Status_RUNING  => '运行中',
            self::Status_STOP  => '停止',
            self::Status_ERR => '错误',
        ];

        if ($type === true) {
            return $desc;
        }
        return $desc[$type] ?? '未知来源';
    }

}
